#开发时间：2022/2/8 9:06
#负责整个项目的配置信息
class Config:
    HOSTNAME = '127.0.0.1'
    PORT = '3306'
    DATABASE = 'test'
    USERNAME = 'root'
    PASSWORD = 'root'
    DB_URI = "mysql+pymysql://{username}:{password}@{host}:{port}/{db}?charset=utf8".format(username=USERNAME,
                                                                                            password=PASSWORD,
                                                                                            host=HOSTNAME, port=PORT,
                                                                                            db=DATABASE)
    SQLALCHEMY_DATABASE_URI = DB_URI
    SQLALCHEMY_TRACK_MODIFICATIONS = False


#开发环境下的配置信息
class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_ECHO = True  #打印sql语句

#生产环境中的配置信息
class ProductConfig(Config):
    pass

#把两个不同环境的配置和字符串映射起来
# map_config = {
#     'develop':DevelopmentConfig,
#     'product':ProductConfig
# }